﻿using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using DBUtility;//请先添加引用
namespace TierApplication
{

    public partial class T_OrderReturnFee
    {
        public DataSet GetSaleReturnFeeList(string strWhere)
        {
            SqlParameter[] parameters = { new SqlParameter("@ac_where ", SqlDbType.VarChar, 500) };
            parameters[0].Value = strWhere;
            DataSet ds = DBUtility.DbHelperSQL.RunProcedure("dbo.GetSaleReturnFeeList", parameters, "Num");
            return ds;

            //StringBuilder strSql = new StringBuilder();
            //strSql.Append(" select a.*, c.DeportIDName SaleDeportIDName, c.CustName SaleCustName, c.InvoiceMoney ContractFee,");
            //strSql.Append(" 	   (Select CodeName from c_OrderStatus where CodeID = a.OrderStatus) OrderStatusName,");
            //strSql.Append("        (Select UserName from P_User where UserID = a.OrderUserID) OrderUserIDName,");
            //strSql.Append("        (Select UserName from P_User where UserID = a.AuditUserID) AuditUserIDName,");
            //strSql.Append("        (Select CodeName from c_OrderType where CodeID = a.OrderType) OrderTypeName,");
            //strSql.Append("        (Select CodeName from c_DepotType where CodeID = a.DepotID) DeportIDName");
            //strSql.Append("   FROM T_OrderReturnFee a, T_OrderInvoice b,S_Order c");
            //strSql.Append("  where a.InvoiceID = b.InvoiceID");
            //strSql.Append("    and b.OrderID=c.OrderID");
            //strSql.Append(" " + strWhere);
            //return DbHelperSQL.Query(strSql.ToString());
        }


        public DataSet GetSaleReturnFeeByInvoiceID(string sInvoiceID)
        {
            StringBuilder strSql = new StringBuilder();
            return GetSaleReturnFeeList(" and a.InvoiceID='" + sInvoiceID + "'");

        }

        public DataSet GetSaleReturnFeeNeedList(string sWhere)
        {
            SqlParameter[] parameters = { new SqlParameter("@ac_where ", SqlDbType.VarChar, 500) };
            parameters[0].Value = sWhere;
            DataSet ds = DBUtility.DbHelperSQL.RunProcedure("dbo.GetSaleReturnFeeNeedList", parameters, "Num");
            return ds;

        }

        public DataSet GetSaleReturnFeeFinishList(string sWhere)
        {
            SqlParameter[] parameters = { new SqlParameter("@ac_where ", SqlDbType.VarChar, 500) };
            parameters[0].Value = sWhere;
            DataSet ds = DBUtility.DbHelperSQL.RunProcedure("dbo.GetSaleReturnFeeFinishList", parameters, "Num");
            return ds;

        }

    }
}

